                <div id="content" class="span10">
                    <!-- content starts -->
                    <div class="row-fluid sortable">
                        <div class="box span12">
                            <div class="box-content">
                                <?php if(!empty($detail)){
                                    foreach ($detail as $row){
                                    ?>
                                <form class="form-horizontal" action="<?php echo base_url();?>trans/update" method="post">
                                  <fieldset>
                                    <legend>Ubah Data Transaksi</legend>
                                    <div class="row-fluid">
                                        <div class="span6">
                                            <div class="control-group">
                                                <label class="control-label" for="tanggal">Tanggal</label>
                                                <div class="controls">
                                                    <input type="hidden" class="span6 typeahead" id="typeahead" name="iddetail" id="iddetail" value="<?=$row['iddetail']?>">
                                                    <input type="text" class="span8 datepicker" name="tanggal" id="tanggal" value="<?php echo date('d/m/Y',strtotime($row['tanggal']));?>" >
                                                </div>
                                            </div>
                                            <div class="control-group">
                                                <label class="control-label" for="typeahead">Nama</label>
                                                <div class="controls">
                                                    <input type="text" class="span8 typeahead" data-provide="typeahead" data-items="5" name="nama" id="nama" data-source='["<?php foreach ($barang as $key){
                                                            echo $key['nama'].'","';
                                                        }?>"]' value="<?=$row['nama']?>">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="span6">
                                            <div class="control-group">
                                                <label class="control-label" for="typeahead">Jumlah</label>
                                                <div class="controls">
                                                    <input type="text" class="span8 typeahead" name="jumlah" id="jumlah" value="<?=$row['jumlah']?>">
                                                </div>
                                            </div>
                                            <div class="control-group">
                                                <label class="control-label" for="typeahead">Keterangan</label>
                                                <div class="controls">
                                                    <select id="idkategori" name="idtransaksi" data-rel="chosen">
                                                        <option selected value="<?=$row['idtransaksi']?>">kode <?=$row['idtransaksi']?>| <?=$row['keterangan']?></option>
                                                        <optgroup label="keterangan baru">
                                                        <?php foreach ($tipe as $row){
                                                            echo '<option value="'.$row['idtransaksi'].'">kode '.$row['idtransaksi'].'| '.$row['keterangan'].'</option>';
                                                        }?>
                                                        </optgroup>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-actions">
                                        <button type="submit" class="btn btn-primary">Submit</button>
                                        <a type="reset" class="btn" href="<?php echo base_url() ?>trans">Cancel</a>
                                    </div>
                                    </fieldset>
                                </form>
                                <?php }}else {?>
                                <form class="form-horizontal" action="<?php echo base_url();?>trans/insert" method="post">
                                  <fieldset>
                                    <legend>Transaksi Baru</legend>
                                    <div class="row-fluid">
                                        <div class="span6">
                                            <div class="control-group">
                                                <label class="control-label" for="tanggal">Tanggal</label>
                                                <div class="controls">
                                                    <input type="text" class="span8 datepicker" name="tanggal" id="tanggal" >
                                                </div>
                                            </div>
                                            <div class="control-group">
                                                <label class="control-label" for="typeahead">Nama</label>
                                                <div class="controls">
                                                    <input type="text" class="span8 typeahead" data-provide="typeahead" data-items="5" name="nama" id="nama" data-source='["<?php foreach ($barang as $row){
                                                            echo $row['nama'].'","';
                                                        }?>"]'>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="span6">
                                            <div class="control-group">
                                                <label class="control-label" for="typeahead">Jumlah</label>
                                                <div class="controls">
                                                    <input type="text" class="span8 typeahead" name="jumlah" id="jumlah" >
                                                </div>
                                            </div>
                                            <div class="control-group">
                                                <label class="control-label" for="typeahead">Keterangan</label>
                                                <div class="controls">
                                                    <select id="idkategori" name="idtransaksi" data-rel="chosen">
                                                        <?php foreach ($tipe as $row){
                                                            echo '<option value="'.$row['idtransaksi'].'">kode '.$row['idtransaksi'].'| '.$row['keterangan'].'</option>';
                                                        }?>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-actions">
                                        <button type="submit" class="btn btn-primary">Submit</button>
                                        <button type="reset" class="btn">Cancel</button>
                                    </div>
                                    </fieldset>
                                </form>
                                <?php } ?>
                            </div>
                        </div>
                        <!--/span-->
                    </div>
                    <?php
                    if (empty($transaksi)){
                        echo "tidak ada data";
                    } 
                    else {
                    
                    ?>
                    <div class="row-fluid sortable">
                        <div class="box span12">
                            <div class="box-content">
                                <table class="table table-striped table-bordered bootstrap-datatable datatable">
                                    <thead>
                                        <tr>
                                            <th>Tanggal</th>
                                            <th>Nama Barang</th>
                                            <th>Keterangan</th>
                                            <th>Jumlah</th>
                                            <th>Aksi</th>
                                        </tr>
                                    </thead>
                                    
                                    <tbody>
                                        <?php
                                    foreach ($transaksi as $row) {
                                    ?>
                                        <tr>
                                            <td><?php echo date('d-m-Y',strtotime($row['tanggal']));?></td>
                                            <td><?=$row['nama']?></td>
                                            <td><?=$row['keterangan']?></td>
                                            <td><?=$row['jumlah']?></td>
                                            <td class="center">
                                                <a class="btn btn-info" href="<?php echo base_url()?>trans/edit/<?=$row['iddetail']?>">
                                                    <i class="icon-edit icon-white"></i>  
                                                    Edit                                            
                                                </a>
                                                <a class="btn btn-danger" href="<?php echo base_url()?>trans/delete/<?=$row['iddetail']?>">
                                                    <i class="icon-trash icon-white"></i> 
                                                    Delete
                                                </a>
                                            </td>
                                        </tr>
                                        <?php
                                        } 
                                        ?>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <!--/span-->
                    </div>
                    <?php 
                }
                    ?>
                    <!--/row-->
                    <!-- content ends -->
                </div>
                <!--/#content.span10-->